| Author |
Thread Statistics | Show CCP posts - 11 post(s) |
|

CCP Snorlax
C C P C C P Alliance
1158

|
Posted - 2017.02.15 16:46:01 -
[1] - Quote
Hagika wrote:You know, there is a shampoo for bugs, it also stops the itching pretty quickly... I tried that on my laptop - I had to get a new one...
CCP Snorlax - Software Architect - Team RnB - @CCP_Snorlax - http://ccpsnorlax.blogspot.is/
|
|
|

CCP Snorlax
C C P C C P Alliance
1158

|
Posted - 2017.02.15 16:47:06 -
[2] - Quote
Sentient Blade wrote:Kicked in the teeth by pointers.... You are now truly an elite programmer.
All the same, pretty nasty.
Then again, whoever wrote the original class didn't take much care to make it easy for themselves or their future colleagues, that's for sure...
It hurts my head to see void Synchro::RemoveSleeper( Heap &sleepers, ...) where it's being passed its own class member as a reference. Out of curiosity are there other heaps of sleepers in use or was this a nasty port of some C code?
Nice job finding it. Yes, there are two kinds of sleepers.
CCP Snorlax - Software Architect - Team RnB - @CCP_Snorlax - http://ccpsnorlax.blogspot.is/
|
|
|

CCP Snorlax
C C P C C P Alliance
1181

|
Posted - 2017.02.16 10:18:46 -
[3] - Quote
Taryn Earendil wrote:I am a C++ newb. When I'm doing systems stuff, I use Rust. Mostly, because I'm into being a hipster developer...... but my question is with this RemoveSleeper function: void Synchro::RemoveSleeper( Heap &sleepers, Sleeper &sl ) { SleeperIt it; for( it = sleepers.begin(); it != sleepers.end(); ++it ) { if( it->channel == sl.channel ) { break; } } if( it != sleepers.end() ) { //Ok found us. Let's delete us. sleepers.Remove( it ); Py_DECREF( sl.channel ); } } Would this be a more succint way to do it? void Synchro::RemoveSleeper( Heap &sleepers, Sleeper &sl ) { SleeperIt it; for( it = sleepers.begin(); it != sleepers.end(); ++it ) { if( it->channel == sl.channel ) { //Ok found us. Let's delete us. sleepers.Remove( it ); Py_DECREF( sl.channel ); break; } } } Yeah, sure, but in this case I omitted some code that was irrelevant to the example.
CCP Snorlax - Software Architect - Team RnB - @CCP_Snorlax - http://ccpsnorlax.blogspot.is/
|
|
|

CCP Snorlax
C C P C C P Alliance
1181

|
Posted - 2017.02.16 10:20:49 -
[4] - Quote
Thoirdhealbhach wrote:Elegbara wrote:Fascinating read.
Also I've actually tried to read the code and there's definitely something wrong in the Synchro::Tick snippet. The for loop seems corrupted. Yep, seems like the last third of the for command got eaten up during copy&paste. Anyhow, my sympathies, I've been chasing some bad reference counting myself for the better part of last month. It seems that a portion of the code looked similar to HTML so the content management system swallowed it - it's been fixed now.
CCP Snorlax - Software Architect - Team RnB - @CCP_Snorlax - http://ccpsnorlax.blogspot.is/
|
|
|

CCP Snorlax
C C P C C P Alliance
1181

|
Posted - 2017.02.16 10:23:10 -
[5] - Quote
Branquinha wrote:(slow clap) (/bows to magnificence of analysis) You must have felt pretty good after that one!  Just out of curiosity, aprox how many hours until you found it? And how many "I'm not finding anything breaks!" ? I don't know how long CCP karkur had spent on this, but after she'd basically proven in had to be in the Sleep command, I spent 3 solid working days on this, much of that in a staring contest with the code...
CCP Snorlax - Software Architect - Team RnB - @CCP_Snorlax - http://ccpsnorlax.blogspot.is/
|
|
|

CCP Snorlax
C C P C C P Alliance
1181

|
Posted - 2017.02.16 10:23:54 -
[6] - Quote
Illiana ShadowGlade wrote:This was an awesome read. I did IT in high school and got paid to run the the servers there over the summers after I graduated and trying to find code was always a pain.
Have you guys tried using the rubber ducky method? Grab a rubber ducky. Sit it on your desk/keyboard what have you... Explain to the duck the code. Two or three times if you have to. Eventually it'll hit you like a truck and you will probably throw the duck across the room because the 'stupid complex problem' has a simple solution, or it's something you never second guessed until that duck just gives you it's dead placid stare. I used a colleague instead. I refrained from throwing him across the room.
CCP Snorlax - Software Architect - Team RnB - @CCP_Snorlax - http://ccpsnorlax.blogspot.is/
|
|
|

CCP Snorlax
C C P C C P Alliance
1192

|
Posted - 2017.02.16 15:02:41 -
[7] - Quote
Tonto Auri wrote:I'm wondering though. Do C++ supports the concept of destructors? In a language that does, I would place all cleanup code in a destructor and call it a day. Especially service objects cleanup. Sure, but the Python C API is just that - a C API, not a C++ API.
CCP Snorlax - Software Architect - Team RnB - @CCP_Snorlax - http://ccpsnorlax.blogspot.is/
|
|
|

CCP Snorlax
C C P C C P Alliance
1201

|
Posted - 2017.02.16 18:51:51 -
[8] - Quote
FearlessLittleToaster wrote:With this bug fixed can you work on the one that makes my ships explode when I undock drunk? I've reproduced it nearly 100% of the time when the conditions exist... I always get a headache when trying to reproduce the bug.
CCP Snorlax - Software Architect - Team RnB - @CCP_Snorlax - http://ccpsnorlax.blogspot.is/
|
|
|

CCP Snorlax
C C P C C P Alliance
1209

|
Posted - 2017.02.17 09:22:12 -
[9] - Quote
Gaius Ambramotte wrote:In your example code was a syntax error as far I understand C++:
if (sleepers.size()) { Be::Time nnow = BeOS->GetActualTime(); for(unsigned int i = 0; iPyError(); } <---- "}" should be " ) {" Py_DECREF(s.channel); } }
The CMS messed with the formatting of the code segments, resulting in some of it disappearing. It's been fixed now.
CCP Snorlax - Software Architect - Team RnB - @CCP_Snorlax - http://ccpsnorlax.blogspot.is/
|
|
| |
|